<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<% String path = request.getContextPath(); request.setCharacterEncoding("UTF-8");
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">   
<head>
<base href="<%=basePath%>">
<title>扫码保单查询</title>
<jsp:include page="/WEB-INF/jsp/common/common.jsp"></jsp:include>	
<link href="css/calendar.css"  rel="stylesheet" type="text/css" >
<link rel="stylesheet" href="<%=path%>/css/zTreeStyle/zTreeStyle.css">
<script type="text/javascript" src="<%=path%>/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.ztree.excheck-3.5.js"></script>
<script src="<%=path%>/js/jquery.divbox.js" type="text/javascript"></script>
<style type="text/css">
.sub-title {
    background: none repeat scroll 0 0 #ffffff;
    font-size: 100%;
    font-weight: bold;
    height: 30px;
    line-height: 30px;
    text-indent: 10px;
    width: 100%;
}
</style>
	<script language="javascript" type="text/javascript">
		var defaultBranch;//保存默认机构的值
		$(document).ready(function() {
			isReadyIframe();
			defaultDate();
		});
		
		function defaultDate(){
			var begin=new Date();
			var end=new Date();
		    new Date(begin.setMonth((new Date().getMonth()-1)));
		    var begintime= begin.format("yyyy-MM-dd");
		    var endtime=end.format("yyyy-MM-dd");
			$("#polSubDateBegin").val(begintime);
			$("#polSubDateEnd").val(endtime);
		}
		function isReadyIframe(){
			var iframe = $(window.parent.document).find("#iframe").length;
			if(iframe==0){
				window.location.href="<%=basePath%>index.jsp";
			}
		}
		
		//------------------------------------------ 合作伙伴 开始----------------------------------------------
		//打开合作伙伴 窗口
		function openChannelInfoDiv(pageIndex,obj){
			$('#channelCode').val('');
			$('#channelName').val('');
			$("#"+obj.id).blur();
			queryTradPartners(pageIndex);
		}
		
		//查询 合作伙伴
		function queryTradPartners(pageIndex){
			var size = 8;
			var channelCode = $.trim($('#channelCode').val());
			var channelName = $.trim($('#channelName').val());
			
			$.openLoading();
			$.ajax({
				url : "<%=path%>/scanPolicyList/queryChannelInfoOfNLife",
				type : 'POST',
				async : true,
				data:{
					pageIndex:pageIndex,
					size:size,
					channelCode:channelCode,
					channelName:channelName
				},
				dataType:'json',
				success:function(page){
					$.closeLoading();
					if($.validate(page))return;
					
					var radioObj ="<input class='input_fxk' name='partnerradio' type='radio' value=''>";
					var fieldNames = "channelCode,channelName";
					var tableContent = creatTable1(fieldNames,page,radioObj);
					var tableObj = $("#channelInfoTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					
					var strPage = creatChannelPage2(pageIndex,6,page.maxPage,"16");
					var pageDIV = $("#channelInfoPageDIV");
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage);
					
					$('#channelInfoDiv').OpenDiv();
					
					bindradio();
				}
			});
		}
		
		//点击“确定”按钮，选择合作伙伴
		function choosePartner(){
			var selectedPartner = $("input[name='partnerradio']:checked");
			if(selectedPartner.length==0){
				$.message("error", "请选择一个合作伙伴");
				return;
			}
			var selectedPartnerNo = selectedPartner.parent().parent().children(" td:eq(1)").html();
			$('#partnerNo').val(selectedPartnerNo);
			closeCurrentDIV('channelInfoDiv');
		}
		//“重置”查询条件
		function  resetCriteria(){
			$('#downloadlifePolicyFileForm input[type!="button"]').val("");
			$('#downloadlifePolicyFileForm select[name!="privilegeBranch"]').val("");
		}
		function bindredio(){
			$("input[name='radioTradProdType']").click(function(){
				$("input[name='radioTradProdType']").parent().parent().removeClass("table_highlighter");
				$(this).parent().parent().addClass("table_highlighter");

		   	});
		}
		function queryPlan(pageCount){
			var planCode=$('#planCode').val();
			var planName=$('#planName').val();
			var partnerNo=$('#partnerNo').val();
			/* if(!$('#partnerNo').val()){
				$.message("error", "请先选中合作伙伴代码");
				return;
			} */
			loadPlan({size:6,current:pageCount,planCode:planCode,planName:planName,partnerNo:partnerNo});
		}
		function loadPlan(param){
			$.openLoading();
			$.ajax({
				url : "<%=path%>/scanPolicyList/queryPlanList",
				type : 'POST',
				async : true,
				dataType:'json',
				data:param,
				success : function(page) {
					$.closeLoading();
					if($.validate(page))return;
					var firstbutton ="<input class='input_fxk' name='radioTemple' type='radio' value=''>";
					var tableContent = creatTable1("PLAN_NO,PLAN_NAME,CODE_NAME,CHANNEL_NAME",page,firstbutton,null);
					var tableObj = $("#planInfoTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					
					var strPage = creatChannelPage(page.current,6,page.maxPage,"91");
					var pageDIV = $("#planInfopageDIV");
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage);
					 bindredio(); 
					$("#planInfoDIV").OpenDiv();
				}
			});
		}
		/**选择方案*/
		function choosePlan(){
			var selectedPlan = $("input[name='radioTemple']:checked");
			if(selectedPlan.length==0){
				$.message("error", "请选择一个合作伙伴");
				return;
			}
			var planNo = selectedPlan.parent().parent().children(" td:eq(1)").html();
			$('#productCode').val(planNo);
			closeCurrentDIV('planInfoDIV');
		}
		function openPlanDiv(){
			$('#planCode').val('');
			$('#planName').val('');
			queryPlan(1);
		}
		//点击“查询”
		function queryLifePolicy(pageIndex){
			var downloadFlag = false;
			if(pageIndex == null){
				pageIndex = 1;
			}
			if(pageIndex == -1){
				pageIndex = 1;
				downloadFlag = true;
			}
			var asyncFlag = true;
			if(pageIndex == -1){
				asyncFlag = false;
			}
			if (checkConditions()) {
				var jsonDate = checkConditions()
			} else {
				return false
			}
			jsonDate.pageIndex = pageIndex
	        summaryHide()
			$.openLoading();
			$.ajax({
				url : "<%=path%>/scanPolicyList/queryScanPolicyPageByCriteria",
				type : 'POST',
				async : asyncFlag,
				dataType:'json',
				data: jsonDate,
				success:function(page){
					$.closeLoading();
					if($.validate(page))return;
					// 查询数据为空
					if (page.data.length ===0) {
						//清空表格数据
                        $("#lifePolicyTable").find("tbody").remove();
                        $("#lifePolicyPageDiv").html("");
	                    $.message("error", "查询数据为空，请正确填写查询条件和页码。");
	                    return;
					}
					//业务处理	
					var firstbutton ="<input class='input_fxk' name='radioTradProdType' type='radio' value='#'>";
					var fieldNames = "polno,partnerName,userCode,insuPlanName,bbrNum,premium,insertTimeStr,beginDateStr,endDateStr,tradProdType@TDH";
					
					$.each(page.data ,function (i, v) {
						v.polno = '<a href="javascript:void(0);" ondblclick="polNoDetailInfoHref(this)">' + v.polno + '</a>'
					})
					
					var tableContent = creatTable1(fieldNames,page,firstbutton,null);																			
					var tableObj = $("#lifePolicyTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					var strPage = creatChannelPage(pageIndex,6,page.maxPage,"27");
					var pageDIV = $("#lifePolicyPageDiv");
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage); 
					bindredio();
				}
			});
		}
		

	//点击文件下载
	function downloadlifePolicyFile(){
		if (checkConditions()) {
            var jsonDate = checkConditions()
        } else {
            return false
        }
        
       $("#downloadlifePolicyFileForm").attr("action","<%=path%>/scanPolicyList/downloadLifePolicyFileByCriteria");
       $("#downloadlifePolicyFileForm").submit();
	}

	//弹出层表格绑定单选按钮事件，选中某个单选按钮，该按钮所在行高亮显示
	function bindradio(){
		$("input[name='prodradio']").click(function(){
			$("input[name='prodradio']").parent().parent().removeClass("table_highlighter");
			$(this).parent().parent().addClass("table_highlighter");
	   	});
		$("input[name='partnerradio']").click(function(){
			$("input[name='partnerradio']").parent().parent().removeClass("table_highlighter");
			$(this).parent().parent().addClass("table_highlighter");
	   	});
		$("input[name='deptradio']").click(function(){
			$("input[name='deptradio']").parent().parent().removeClass("table_highlighter");
			$(this).parent().parent().addClass("table_highlighter");
	   	});
	}

	//统一 关闭窗口(传入要关闭DIV的id)
	function closeCurrentDIV(obj){
			$("#"+obj).CloseDiv();	
	}

	<%-- added by gzz@2015-11-3 for shen zhen you hua begin --%>
	function polNoDetailInfoHref(obj){
			var polNo = $(obj).parent('td').parent('tr')[0].childNodes[1].childNodes[0].innerHTML;
			var tradProdType = $(obj).parent('td').parent('tr')[0].childNodes[10].innerHTML;
	 		$(obj).parent('td').parent('tr').find("input[name='radioTradProdType']").prop("checked",true);
	 		$("input[name='radioTradProdType']").parent().parent().removeClass("table_highlighter");
	 		$(obj).parent('td').parent('tr').addClass("table_highlighter");
	 		viewDetail_singel(polNo,tradProdType);
	}
	function polNoDetailInfo(){
		var radioProduct = $("input[name='radioTradProdType']:checked");
		if(radioProduct.val()!=undefined){
			var polNo = $(radioProduct).parent('td').parent('tr')[0].childNodes[1].childNodes[0].innerHTML;
			var tradProdType = $(radioProduct).parent('td').parent('tr')[0].childNodes[10].innerHTML;
	 		viewDetail_singel(polNo,tradProdType);
		}else{
			$.message("error", "请选择一个保单");
		}
	}
	//详细信息查看
	function viewDetail_singel(polNo,tradProdType){
		$.ajax({
			url : "<%=path%>/scanPolicyList/queryViewDetail?+"+new Date().getTime(),
			type : 'POST',
			async:true,
			dataType:'json',
			data:{polNo:polNo,tradProdType:tradProdType},
			success : function(page) {
				if($.validate(page))return;
				var data = page.obj;
				if(data.policy_detail_Info!=null){
					$('#singel_polno').html(data.policy_detail_Info.polno);
					$('#singel_planDscp').html(data.policy_detail_Info.insuPlanName);
					$('#singel_insertTime').html(data.policy_detail_Info.insertTimeStr);
					$('#singel_days').html(data.policy_detail_Info.insureDays);
					$('#singel_productUnit').html(data.policy_detail_Info.productUnit);
					$('#singel_beginDate').html(data.policy_detail_Info.beginDateStr);
					$('#singel_endDate').html(data.policy_detail_Info.endDateStr);
					$('#singel_premium').html(data.policy_detail_Info.premiumFormatStr);
					$('#singel_amount').html(data.policy_detail_Info.amountFormatStr);
					$('#singel_spicalArran').html(data.policy_detail_Info.spicalArran);
					$('#singel_premNotax').html(data.policy_detail_Info.premNotax);
					$('#singel_premVat').html(data.policy_detail_Info.premVat);
					if(("Y"!=data.policy_detail_Info.isEpolicyl) ||  (data.policy_detail_Info.epolicyUrl ==null)){
						$("#singelIsEpolicyl").hide();
					}else{
						$("#singelIsEpolicyl").show();
						$("#singelEpolicylUrl").attr("href",data.policy_detail_Info.epolicyUrl);
					}
					if("2"==tradProdType&&(data.policy_detail_Info.licenseno!=null||data.policy_detail_Info.frameno!=null)){
						$('#drive_bbrNum').html(data.policy_detail_Info.bbrNum);
						$('#drive_usenatureDscp').html(data.policy_detail_Info.usenatureDscp);
						$('#drive_frameno').html(data.policy_detail_Info.frameno);
						$('#drive_licenseno').html(data.policy_detail_Info.licenseno);
						$('#drive_div_Info').show();
						$('#drive_div_Info1').show();
						$('#drive_bbr_jc_tableInfo').show();
					}else{
						$('#drive_div_Info').hide();
						$('#drive_div_Info1').hide();
						$('#drive_bbr_jc_tableInfo').hide();
					}
					if("3"==tradProdType){
						$('#line_Info').show();
						$('#single_line').html(data.policy_detail_Info.appContent);
					}else{
						$('#line_Info').hide();
					}
				}
				if(data.syr_detail_Info!=null){
					$('#singel_syr_realName').html(data.syr_detail_Info.clientName);
					if('01'==data.syr_detail_Info.idType){
						$('#singel_bbr_certiType').html("身份证");
					}else{
						$('#singel_bbr_certiType').html("");
					}
					$('#singel_bbr_certiCode').html(data.syr_detail_Info.idNo);
					$('#singel_syr_benePct').html(data.syr_detail_Info.benePct);
					$('#nlife_singel_syr_tableInfo').show();
					$('#singel_syr_fd_tableInfo').hide();
				}else{
					$('#singel_syr_fd_tableInfo').show();
					$('#nlife_singel_syr_tableInfo').hide();
				}
				if(data.bbr_detail_Info!=null){
					$('#singel_bbr_realName').html(data.bbr_detail_Info.clientName);
					if('01'==data.bbr_detail_Info.idType){
						$('#singel_bbr_certiType').html("身份证");
					}else{
						$('#singel_bbr_certiType').html("");
					}
					$('#singel_bbr_certiCode').html(data.bbr_detail_Info.idNo);
					$('#singel_bbr_telephone').html(data.bbr_detail_Info.clientTel);
					$('#nlife_div_bbrInfo').show();
					if("1"==tradProdType){
						$('#singel_bbr_schoolName').html(data.bbr_detail_Info.schoolName);
						$('#singel_bbr_grad').html(data.bbr_detail_Info.grad);
						$('#singel_bbr_className').html(data.bbr_detail_Info.className);
						$('#bbr_school_info').show();
						$('#bbr_school_info1').show();
						$('#bbr_info_title').html("学生信息");
						$('#bbr_name').html("姓名：");
					}else{
						$('#bbr_school_info').hide();
						$('#bbr_school_info1').hide();
						$('#bbr_info_title').html("被保人信息")
						$('#bbr_name').html("被保人姓名：")
					}
				}else{
					$('#nlife_div_bbrInfo').hide();
				}
				if(data.tbr_detail_Info!=null){
					$('#singel_realName').html(data.tbr_detail_Info.clientName);
					if('01'==data.tbr_detail_Info.idType){
						$('#singel_certiType').html("身份证");
					}else{
						$('#singel_certiType').html("");
					}
					if('1'==data.tbr_detail_Info.sex){
						$('#singel_gender').html("男");
					}else if('0'==data.tbr_detail_Info.sex){
						$('#singel_gender').html("女");
					}else if('3'==data.tbr_detail_Info.sex){
						$('#singel_gender').html("未知");
					}else{
						$('#singel_gender').html("");
					}
					$('#singel_certiCode').html(data.tbr_detail_Info.idNo);
					$('#singel_telephone').val(data.tbr_detail_Info.clientTel);
					$('#singel_email').val(data.tbr_detail_Info.email);
				}
				if(data.nlife_xz_detail_Info!=undefined && data.nlife_xz_detail_Info!=null){
					var Page= new Object();
					Page.data  = data.nlife_xz_detail_Info;
					var fieldNames = "riskName,covName,covAmtStr";
					var tableContent = creatTable1(fieldNames,Page,null,null);																			
					var tableObj = $("#nlife_singel_xz_tableInfo");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					$('#nlife_div_singel_xz_tableInfo').show();
				}
				$('#policyDetailInfo').OpenDiv();
			}
		});
	}

	//日期格式化
	Date.prototype.format = function(format)
	{
		var o = {
		 "M+" : this.getMonth()+1, //month
 		"d+" : this.getDate(),    //day
	 	"h+" : this.getHours(),   //hour
 		"m+" : this.getMinutes(), //minute
 		"s+" : this.getSeconds(), //second
 		"q+" : Math.floor((this.getMonth()+3)/3),  //quarter
 		"S" : this.getMilliseconds() //millisecond
 	}
 		if(/(y+)/.test(format)) format=format.replace(RegExp.$1,
 		(this.getFullYear()+"").substr(4 - RegExp.$1.length));
 		for(var k in o)if(new RegExp("("+ k +")").test(format))
 		format = format.replace(RegExp.$1,
 		RegExp.$1.length==1 ? o[k] :
 		("00"+ o[k]).substr((""+ o[k]).length));
 		return format;
}
	
	// 清空并隐藏汇总
	function summaryHide() {
	    $('#summary_div').hide()
		// 清空总量
        $("#countValidPolicy").text("0");
        $("#totalPremium").text("0");
	}
	
	// 展示汇总
	function summaryShow() {
		// 清空
		summaryHide()
		var jsonDate = checkConditions()

        if (!jsonDate) {
            $.closeLoading();
            return false
        }
	    $.openLoading();
		$.ajax({
            url : "<%=path%>/scanPolicyList/queryScanPolicyAll",
            type : 'POST',
            async : true,
            dataType:'json',
            data: jsonDate,
            success:function(data){
                $.closeLoading();
                $("#countValidPolicy").text(data.COUNT_TOTAL);//有效保单笔数
                $("#totalPremium").text(data.PREMIUM_VALID);//设置保费合计
                $('#summary_div').show()
            }
        });
	}
	
	// 校验查询条件
	function checkConditions() {
        var partnerNo = $.trim($("#partnerNo").val());//合作伙伴
        var productCode= $.trim($("#productCode").val());//方案号
        var polSubDateBegin=  $.trim($("#polSubDateBegin").val());//保单提交日期
        var polSubDateEnd=  $.trim($("#polSubDateEnd").val());
        var polBeginDateBegin=  $.trim($("#polBeginDateBegin").val());//保单生效日期
        var polBeginDateEnd=  $.trim($("#polBeginDateEnd").val());
        var polno =$.trim($("#polno").val());//保单号
        var userCode =$.trim($("#userCode").val());//用户名
        var jsonDate = {
                partnerNo:partnerNo,
                productCode:productCode,
                polSubDateBegin:polSubDateBegin,
                polSubDateEnd:polSubDateEnd,
                polBeginDateBegin:polBeginDateBegin,
                polBeginDateEnd:polBeginDateEnd,
                polno:polno,
                userCode:userCode,
            }
		
        
        // 综合控制  如果没录被保人证件号  带素引的条件必录一个
        if (!jsonDate.partnerNo && !jsonDate.userCode && !jsonDate.productCode) {
        	// 日期区间为提交日期一年之内或者生效日期一年之内 
            var subBeginDate = (jsonDate.polSubDateBegin&&jsonDate.polSubDateEnd)?dateAddYear(jsonDate.polSubDateBegin, 0):-1
            var subEndDate = (jsonDate.polSubDateBegin&&jsonDate.polSubDateEnd)?dateAddYear(jsonDate.polSubDateEnd, 1):0
            var polBeginDate =  (jsonDate.polBeginDateBegin&&jsonDate.polBeginDateEnd)?dateAddYear(jsonDate.polBeginDateBegin, 0):-1
            var polEndDate =  (jsonDate.polBeginDateBegin&&jsonDate.polBeginDateEnd)?dateAddYear(jsonDate.polBeginDateEnd, 1):0

            if ((subBeginDate - subEndDate < 0) && (polBeginDate - polEndDate < 0)) {
                $.message('error', '请选择近一年的日期区间或者合作伙伴、方案号、个人（用户名）必录一项！')
                return false 
            }
        }
        
        return jsonDate
	}
	
	// 日期加减年且格式转换
	function dateAddYear (dateString, yearCount) {
		var newstr = (dateString.substr(0, 4) - yearCount) + dateString.substr(4)
		return new Date(newstr.replace(/-/g, "/")).getTime();
	}
		
	/**邮件重发*/
	function reSendEmail(){
		var polNo=$('#singel_polno').html();
		var  email=$('#singel_email').val();
		var reg=/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/;
		if(!reg.test(email)){
			$.message("error", "邮箱有误！");
			return;
		}
		$.openLoading();

		$.ajax({
			url : "<%=path%>/scanPolicyList/reSendEmail?+"+new Date().getTime(),
			type : 'POST',
			async:true,
			dataType:'json',
			data:{polNo:polNo,email:email},
			success : function(result) {
				$.closeLoading();
				$.message(result.result,result.message);
			}
		});
	}
	/**短信重发*/
	function reSendSMS(){
		
		var polNo=$('#singel_polno').html();
		var  phoneNo=$('#singel_telephone').val();
		var reg=/^[1][3,4,5,7,8][0-9]{9}$/;
		if(!reg.test(phoneNo)){
			$.message("error", "手机号有误！");
			return;
		}
		$.openLoading();

		$.ajax({
			url : "<%=path%>/scanPolicyList/reSendSms?+"+new Date().getTime(),
			type : 'POST',
			async:true,
			dataType:'json',
			data:{polNo:polNo,phoneNo:phoneNo},
			success : function(result) {
				$.closeLoading();
				$.message(result.result,result.message);
			}
		});
	}
	
	</script>
	
	</head>
	<body>
	<form method="POST" name="form2">
	<input type="hidden" name="polNo" id="downLoadPolNoStr">
	</form>
 	 <div class="current">
           <table class="current_table_1">
             <tbody>
              	<tr class="f2">
	                <td><img src="./images/current_1.jpg"></td>
	                <td class="current_table_1_td">
	                  <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
	                  <span style=" color:#136bab; ">统计分析
	                  	<span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>扫码保单查询
	                  </span>
                  	</td>
                 	<td><img src="./images/current_3.jpg"></td>
              	</tr>
           	 </tbody>
           </table>
     </div>
       
       <!--查询条件及结果表单 -->
        <table border="1" class="table_02" style="height:150px">
	  		<tr height="50px">
	  			<td colspan="2" align="center">
	  				<form method="post" id="downloadlifePolicyFileForm"> 
						<table border="0" style="margin: 12px auto;">
							<tr>
								<td style="border: 0;text-align: right" nowrap="nowrap">合作伙伴：</td>
		                        <td style="border: 0 ;text-align: left; padding-right: 70px"><input name="partnerNo" id="partnerNo" readonly="readonly" onselect="" style=" background-color: #ccc;" class="input_text">&nbsp;&nbsp;<input type="button"  class="input_button_5"  id="searchPartnerBtn" value="请选择" onClick="openChannelInfoDiv(1,this)"/></td>
								<td style="border: 0;text-align: right" nowrap="nowrap">方案号：</td>
		                        <td style="border: 0 ;text-align: left; padding-right: 70px"><input name="productCode" id="productCode"  style=" background-color: #ccc;" class="input_text">&nbsp;&nbsp;<input type="button"  class="input_button_5"  id="searchPlan" value="请选择" onClick="openPlanDiv()"/></td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">个人（用户名）：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									<input name="userCode" id="userCode" class="input_text" style="width:130px;" size="25"/>
								</td>
							</tr>
							<tr>
								<td style="border: 0;text-align: right;" nowrap="nowrap">保单提交日期：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									 <input id="polSubDateBegin" name="polSubDateBegin" readonly="readonly" onclick="showCalendar('polSubDateBegin','y-mm-dd');"   class="input_time"/>
								</td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">至：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									 <input id="polSubDateEnd" name="polSubDateEnd" readonly="readonly" onclick="showCalendar('polSubDateEnd','y-mm-dd');"  class="input_time"/>
								</td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">保单号：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									<input name="polno" id="polno" class="input_text" style="width:130px;" size="25"/>
								</td>
							</tr>
							<tr>
								<td style="border: 0;text-align: right;" nowrap="nowrap">保单生效日期：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									 <input id="polBeginDateBegin" name="polBeginDateBegin" readonly="readonly" onclick="showCalendar('polBeginDateBegin','y-mm-dd');"  class="input_time"/>
								</td>
								<td style="border: 0;text-align: right;" nowrap="nowrap">至：</td>
								<td style="border: 0;text-align: left;padding-right: 70px">
									 <input id="polBeginDateEnd" name="polBeginDateEnd" readonly="readonly" onclick="showCalendar('polBeginDateEnd','y-mm-dd');"  class="input_time"/>
								</td>
							</tr>
							<tr>
								<td colspan="6" style="border: 0;padding-top: 5px;padding-right: 70px">
									<input type="button"  class="input_button_1"  value="查询"    onClick="queryLifePolicy(1)"/>
								   	<input type="button"  class="input_button_1"  value="重置"    onClick="resetCriteria()"/>
								</td>
							</tr>
						</table>	  				
				    </form>
				</td>
	  		</tr>
	  		<tr>
	  			<td valign="top">
		  			<div id="lifePolicyDiv" style="width:98%;margin:5px" >
		  				<div align="left" style="margin:15px">
			  				<input type="button"  class="input_button_2"  value="导出Excel" onClick="downloadlifePolicyFile()"/>&nbsp;
			  				<input type="button"  class="input_button_2"  value="详细信息" onClick="polNoDetailInfo()"/>&nbsp;
			  				<!-- 汇总按钮 -->
			  				<input style="float: right" type="button"  onclick="summaryShow()" id="summary_btn" class="input_button_2"  value="展示汇总"/>
							<!-- 汇总点击按钮才展示 -->
							<div align="right" id="summary_div" style="margin:10px;display:none;">
								<span>保单笔数：</span><span id="countValidPolicy" style="color: red">0</span>笔&nbsp;&nbsp;
								<span>含税保费合计：</span><span id="totalPremium" style="color: red">0</span>元&nbsp;&nbsp;
							</div>
				  		</div>
				  		<table class="table_02" id="lifePolicyTable">
					  		<thead>
				               <tr>
				               	  <th style="width:4%" nowrap="nowrap">选择</th>
				                  <th style="width:15%" nowrap="nowrap">保单号</th>
				                  <th style="width:10%" nowrap="nowrap">合作伙伴</th>
				                  <th style="width:8%" nowrap="nowrap">个人（用户名）</th>
				                  <th style="width:10%" nowrap="nowrap">投保方案</th>
				                  <th style="width:5%" nowrap="nowrap">人数</th>
				                  <th style="width:5%" nowrap="nowrap">含税保费</th>
				                  <th style="width:9%" nowrap="nowrap">保单提交日期</th>
				                  <th style="width:9%" nowrap="nowrap">起保日期</th>
				                  <th style="width:9%" nowrap="nowrap">终保日期</th>
				              	</tr>
				              </thead>
			              <tbody>
						  </tbody>
			            </table>
		  				 <div id="lifePolicyPageDiv"  class="page"></div>
		  			</div>
	  			</td>
	  		</tr>
	  	</table>
       
    <!--选择 合作伙伴 div 默认隐藏-->
  	<div id="channelInfoDiv" style="display:none;width:80%;">
		<div class="table_title_div">
			<table class="table_title" style='width:100%;height: 20px;'>
				<tr>
				<td width="10%"></td>
				<td width="80%" id="interfaceName"></td>
				<td width="10%" align="right"><img src="./images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('channelInfoDiv')"/></td>
				</tr>
			</table>
		</div>
		<table class="table_02" id="table" style="height:180px;" align="center">
			<tr>
				<td>
					<table class="search_table">
						<tr height="30px">
							<td colspan="3" style="text-align:center">
							 合作伙伴代码：<input name="txt3"  id="channelCode"  type="text" class="input_text" value="" >&nbsp;&nbsp;
							 合作伙伴名称：<input name="txt3" id="channelName"  type="text" class="input_text" value="">&nbsp;&nbsp;
								       <input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="queryTradPartners(1)"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table id="channelInfoTable"  class="content_table_1">
						<thead>
							<tr class="f1">
			                  <th style="width:5%">选择</th>
			                  <th style="width:10%">合作伙伴代码</th>
			                  <th style="width:20%">合作伙伴名称</th>
			              	</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
					<div id="channelInfoPageDIV"  class="page"></div>
				</td>
			</tr>
		</table>
		<div align="center" >
		  <input type="button" id="saveRoleBtn" value="确定" onclick="choosePartner()" class="input_button_3"/>&nbsp;&nbsp;&nbsp;
		  <input type="button" value="取消" onclick="closeCurrentDIV('channelInfoDiv')" class="input_button_3"/>
		</div>
	</div>
	
	<%-- 个单投保流程 --%>
	<div id="policyDetailInfo" style="display: none;width: 65%;height:75%; padding-bottom: 10px;margin-top: -50px;overflow-y:auto;">
  		<div class="table_title_div">
				<table class="table_title" style='width:100%;height: 20px;'>
					<tr>
						<td width="10%"></td>
						<td width="80%" id="interfaceName"></td>
						<td width="10%" align="right"><img src="<%=path %>/images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('policyDetailInfo')"/></td>
					</tr>
				</table>
		</div>
		<div>
		<ul style="padding-top: 8px;">
		<li style="float: left;  width: 80% "><h5 class="sub-title">基本信息</h5></li>
		<li style="float: left;  width: 20%"><span id="singelIsEpolicyl" style="height: 30px;line-height: 30px; text-indent: 10px; "><a href="" id="singelEpolicylUrl" target="_blank" style="color: blue;  text-decoration:underline;" >电子保单下载 </a></span></li>
		</ul>
		</div>
		<table class="table_02" align="center" style="width: 95%;">
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">保单号：</td>
				<td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><span id = "singel_polno"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%"></td>
				<td style="text-align:left;padding-left:6px;" width="35%"></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">投保方案：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_planDscp"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">提交日期：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_insertTime"></span></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">保险天数：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_days"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">投保份数：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_productUnit"></span></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">起保日期：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_beginDate"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">终保日期：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_endDate"></span></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">含税保费：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_premium"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">不含税保费：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_premNotax"></span></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">增值税额：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_premVat"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">总保额：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_amount"></span></td>
			</tr>
			<tr id = "drive_div_Info">
				<td style="text-align:right;border-right: 0px;" width="15%">投保座位数：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "drive_bbrNum"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">车辆使用性质：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "drive_usenatureDscp"></span></td>
			</tr>
			<tr id = "drive_div_Info1">
				<td style="text-align:right;border-right: 0px;" width="15%">车架号：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "drive_frameno"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">车牌号：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "drive_licenseno"></span></td>
			</tr>
			<tr id = "line_Info">
				<td style="text-align:right;border-right: 0px;" width="15%">旅行目的地：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "single_line"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%"></td>
				<td style="text-align:left;padding-left:6px;" width="35%"></td>
			</tr>
		</table>
		<h5 class="sub-title">投保人信息</h5>
		<table class="table_02" align="center" style="width: 95%;">
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">投保人姓名：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_realName"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">性别：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_gender"></span></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">证件类型：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_certiType"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">证件号码：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_certiCode"></span></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">电子邮箱：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><input id = "singel_email" style="width:135px"/><input type="button" value="邮件重发" id="reSendEmail" onclick='reSendEmail()'class="input_button_2"></td>
				<td style="text-align:right;border-right: 0px;" width="15%">联系电话：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><input id = "singel_telephone" style="width:135px"/><input type="button"  value="短信重发" id="reSendSMS" onclick='reSendSMS()' class="input_button_2"></td>
			</tr>
		</table>
		<h5 class="sub-title" id="bbr_info_title">被保人信息</h5>
		<table id = "nlife_div_bbrInfo" class="table_02" align="center" style="width: 95%;">
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%" id="bbr_name">被保人姓名：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_bbr_realName"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">联系电话：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_bbr_telephone"></span></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">证件类型：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_bbr_certiType"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">证件号码：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_bbr_certiCode"></span></td>
			</tr>
			<tr id='bbr_school_info'>
				<td style="text-align:right;border-right: 0px;" width="15%">学校：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_bbr_schoolName"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">年级：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_bbr_grad"></span></td>
			</tr>
			<tr id='bbr_school_info1'>
				<td style="text-align:right;border-right: 0px;" width="15%">班级：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_bbr_className"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%"></td>
				<td style="text-align:left;padding-left:6px;" width="35%"></td>
			</tr>
		</table>
		<table id = "drive_bbr_jc_tableInfo" class="table_02" align="center" style="width: 95%;">
			<tr>
				<td colspan="4" style="text-align:center;" width="100%">发生保险责任范围内的交通事故时驾驶或乘坐本保险合同载明的车辆内的人员</td>
			</tr>
		</table>
		<h5 class="sub-title">受益人信息</h5>
		<table id = "singel_syr_fd_tableInfo" class="table_02" align="center" style="width: 95%;">
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">受益人：</td>
				<td colspan="3" style="text-align:left;padding-left:6px;" width="85%">法定</td>
			</tr>
		</table>
		<table id="nlife_singel_syr_tableInfo" class="table_02" align="center" style="width: 95%;">
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">受益人姓名：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_syr_realName"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">受益人比例：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_syr_benePct"></span></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right: 0px;" width="15%">证件类型：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_syr_certiType"></span></td>
				<td style="text-align:right;border-right: 0px;" width="15%">证件号码：</td>
				<td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_syr_certiCode"></span></td>
			</tr>
		</table>
		<div id ="nlife_div_singel_xz_tableInfo" style="display: none;width: 100%;">
			<h5 class="sub-title">条款责任信息</h5>
		<table id= "nlife_singel_xz_tableInfo" class="table_02" align="center" style="width: 95%;">
		 <thead>
			<th width="45" nowrap="nowrap">条款名称</th>
			<th width="40" nowrap="nowrap">责任名称</th>
			<th width="15" nowrap="nowrap">保额</th>
		 </thead>
		 <tbody>
	     </tbody>
		</table>
		</div>
		<h5 class="sub-title">特别约定</h5>
		<table class="table_02" align="center" style="width: 95%;">
			<tr>
				<td style="text-align:left;padding-left: 6px;" width="100%"><span id="singel_spicalArran" ></span></td>
			</tr>
		</table>
	</div>
	
<div id="planInfoDIV" style="display:none;width:80%;">
		<div class="table_title_div">
				<table class="table_title" style='width:100%;height: 20px;'>
					<tr>
						<td width="10%"></td>
						<td width="80%" id="interfaceName"></td>
						<td width="10%" align="right"><img src="<%=path %>/images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('planInfoDIV')"/></td>
					</tr>
				</table>
		</div>
		<table class="table_02"  style="height:180px; " align="center" >
			<tbody>
				<tr>
					<td>
						<table class="search_table">
							<tbody>
								<tr height="30px">
									<td width="40%" height="30px">方案代码：
										<input name="txt3" id="planCode" type="text" class="input_text" value="" style="width:220px;">
									</td>
									<td width="40%" height="30px">方案名称：
										<input name="txt3" id="planName" type="text" class="input_text" value="" style="width:220px;">
									</td>
									<td width="20%" height="30px">
									   <input type="button" class="input_button_1" id="searchBtn" value="查询" onclick="queryPlan(1)">&nbsp;
									</td>
								</tr>	
							</tbody>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table id="planInfoTable"  class="content_table_1">
							<thead>
								<tr class="f1">
				                  <th style="width:5%">选择</th>
				                  <th style="width:15%">方案代码</th>
				                  <th style="width:20%">方案名称</th>
				                  <th style="width:20%">产品大类</th>
				                  <th style="width:40%">合作伙伴名称</th>
				              	</tr>
							</thead>
							<tbody>
							</tbody>
						</table>
						<div id="planInfopageDIV"  class="page"></div>
					</td>
				</tr>
			</tbody>
		</table>
		<div align="center">
		 <input class="input_button_3" name="" type="button" onclick="choosePlan()" value="保存">&nbsp;&nbsp;
         <input class="input_button_3" name="" type="button" onclick="closeCurrentDIV('planInfoDIV')" value="取消">
		</div>
</div>

	
	</body>
</html>
